package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.GetBetDetailsAction;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;
import com.aptemo.webetek.shared.BetBean;

public class BetDetailsHandler
		extends ActionHandler<GetBetDetailsAction, BetBean>
{

	public BetDetailsHandler(DataStoreAPI service)
	{
		super(service);
	}

	public Class<? extends Action<?>> getActionType()
	{
		return GetBetDetailsAction.class;
	}

	@Override
	public BetBean invoke(GetBetDetailsAction action) throws BackendException
	{
		// return mparent.getStakeDetails(action.getId());
		return dataService.getBet(action.getId());
	}

}
